package com.haighcom.common;//package com.haighcom.common;
//
//import com.haighcom.config.RedisConfig;
//import com.sun.org.apache.xpath.internal.SourceTree;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.SpringBootApplication;
//import org.springframework.scheduling.annotation.EnableScheduling;
//import org.springframework.scheduling.annotation.Scheduled;
//import redis.clients.jedis.JedisPool;
//
//import javax.annotation.PostConstruct;
//import java.util.Set;
//
//@EnableScheduling
//@SpringBootApplication
//public class DemoApplication {
//
//    private static JedisPool jedisPool;
//    @Autowired
//    private RedisConfig redisConfig;
//
//    @PostConstruct
//    public void init(){
//        jedisPool = redisConfig.redisPoolFactory();
//    }
//
//    @Scheduled(cron = "0/5 * * * * ?")
//    public void job1(){
//        Set<String> set = jedisPool.getResource().sdiff(RedisConstant.SETMEAL_PIC_RESOURCES, RedisConstant.SETMEAL_PIC_DB_RESOURCES);
//
//        if (set != null){
//            for (String picname : set) {
//                QiniuUtils.deleteFileFromQiniu(picname);
//                jedisPool.getResource().srem(RedisConstant.SETMEAL_PIC_RESOURCES,picname);
//                System.out.println("自定义定时任务执行，清理垃圾图片："+picname);
//            }
//        }
//    }
//
//}
